package com.myhome.controller;

import com.myhome.config.constant.R;
import com.myhome.domain.CashRecharge;
import com.myhome.domain.CashRechargeAuditRecord;
import com.myhome.service.CashRechargeService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author QYiXin
 * @Date 2021 10 23 09 31
 **/
@RestController
@RequestMapping("/cashRecharge")
public class CashRechargeUpdateController {
    @Autowired
    CashRechargeService cashRechargeService;
    @PostMapping("/cashRechargeUpdateStatus")
    @ApiOperation("审核场外交易体现")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "cashRechargeAuditRecord", value = "审核信息")
    })
    public R cashRechargeUpdateStatus(@RequestBody CashRechargeAuditRecord cashRechargeAuditRecord) {
        Boolean isUpdateStatus = cashRechargeService.updateCashRechargeStatus(cashRechargeAuditRecord);
        if (isUpdateStatus) {
            return R.ok();
        }
        return R.fail("审核失败");
    }
}
